/*
 * @Author: xuxu12138 1718324422@qq.com
 * @Date: 2023-09-23 08:36:56
 * @LastEditors: xuxu12138 1718324422@qq.com
 * @LastEditTime: 2024-07-18 10:52:31
 * @FilePath: /things-admin/src/base/api/DataScreen.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {request} from '@/base/Request';
import {profession, eara, province, city, sex, statusData} from '../model/DataScreen'

//会员数据
export const Profession = (provinceId:Number,cityId:Number) =>request.getArray(sex,`/api/screen/genderStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//会员职业数据
// /api/screen/careerStatistics

export const careerStatistics = (provinceId:Number,cityId:Number) => request.getArray(profession,`/api/screen/careerStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//在线程序下载
// /api/screen/downloadProgramStatistics
export const downloadProgramStatistics = (provinceId:Number,cityId:Number) =>request.getArray(profession,`/api/screen/downloadProgramStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//疲劳值检测
// /api/screen/fatigueStatistics
export const fatigueStatistics = (provinceId:Number,cityId:Number) =>request.getArray(profession,`/api/screen/fatigueStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//健康数据平均值
// /api/screen/healthStatistics
export const healthStatistics = (provinceId:Number,cityId:Number) =>request.getArray(profession,`/api/screen/healthStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//会员兴趣占比
// /api/screen/interestStatistics
export const interestStatistics = (provinceId:Number,cityId:Number) =>request.getArray(profession,`/api/screen/interestStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//会员年龄统计
// /api/screen/membershipAgeStatistics
export const membershipAgeStatistics = (provinceId:Number,cityId:Number) => request.getArray(profession,`/api/screen/membershipAgeStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//按摩时长次数统计
// /api/screen/modelModeUsageStatistics
export const modelModeUsageStatistics = (provinceId:Number,cityId:Number) => request.getArray(profession,`/api/screen/modelModeUsageStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//设备月份统计
// /api/screen/equipmentMonthlyStatistics
export const equipmentMonthlyStatistics = (provinceId:Number,cityId:Number) => request.getArray(profession,`/api/screen/equipmentMonthlyStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//设备总数及同比增加
// /api/screen/annualIncreaseStatistics
export const annualIncreaseStatistics = (provinceId:Number,cityId:Number) => request.getArray(profession,`/api/screen/annualIncreaseStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//省份按摩椅统计
// /api/screen/provincialStatistics
export const provincialStatistics = () => request.getArray(profession,`/api/screen/provincialStatistics`)

//全国按摩椅TOP10
// /api/screen/provinceNumberStatistics
export const provinceNumberStatistics = (provinceId:Number,cityId:Number) => request.getArray(profession,`/api/screen/provinceNumberStatistics?cityId=${cityId}&provinceId=${provinceId}`)

// 售后数据 /api/post-sale/statistics
export const statistics = (provinceId:Number,cityId:Number,dealerld:number,type:string) => request.get(String,`/api/post-sale/statistics?cityId=${cityId}&provinceId=${provinceId}&dealerld=${dealerld}&type=${type}`)
//按摩椅数量型号
// /api/screen/modelStatistics
export const modelStatistics = (provinceId:Number,cityId:Number) => request.getArray(profession,`/api/screen/modelStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//总按摩时长和次数统计
// /api/screen/totalMassageStatistics
export const totalMassageStatistics = (provinceId:Number,cityId:Number) => request.get(profession,`/api/screen/totalMassageStatistics?cityId=${cityId}&provinceId=${provinceId}`)

//获取大区
// /api/area/region
export const region = () => request.getArray(eara,'/api/area/region')

//获取省份
// /api/area/province
export const getProvince = (id:any) => request.getArray(province,`/api/area/province?regionId=${id}` )

// 获取城市
// /api/area/city
export const getCity = (regionId:any,provinceId:any) => request.getArray(city,`/api/area/city?regionId=${regionId}&provinceId=${provinceId}`)

//天气测试 https://api.seniverse.com/v3/weather/now.json?key=your_api_key&location=beijing&language=zh-Hans&unit=c
export const weather = (key:String,citys:String) => request.get(city,`https://api.seniverse.com/v3/weather/now.json?key=${key}&location=${citys}&language=zh-Hans&unit=c`)

// /screen/memberMonthlyStatistics 游客增长月统计
export const memberMonthlyStatistics = () => request.getArray(province, 'api/screen/memberMonthlyStatistics')

///screen/memberProportion 游客会员占比
export const memberProportion = () => request.getArray(province, '/api/screen/memberProportion')

// /api/screen/stateStatistics 设备状态统计
export const stateStatistics = () => request.getArray(statusData, '/api/screen/modelStateStatistics')

// /api/screen/modelMassageStatistics 各型号按摩次数
export const modelMassageStatistics = (provinceId:any,cityId:any) => request.getArray(province,`/api/screen/modelMassageStatistics?cityId=${cityId}&provinceId=${provinceId}`)